﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace XPathAutoSuggest {
    /// <summary>
    /// A form that hosts some links to web sites describing XPath
    /// </summary>
    public partial class HelpLinks : Window {
        private ViewModels.HelpLinks_ViewModel _Vm;

        /// <summary>
        /// Default constructor
        /// </summary>
        public HelpLinks() {
            InitializeComponent();
            _Vm = new XPathAutoSuggest.ViewModels.HelpLinks_ViewModel();
            //Enable data binding to the ViewModel's commands
            this.DataContext = _Vm;

            _Vm.CloseLinks += new XPathAutoSuggest.ViewModels.HelpLinks_ViewModel.CloseCommandDlgt(_Vm_CloseLinks);
        }

        /// <summary>
        /// Catches the event raised by our ViewModel to close the form
        /// </summary>
        /// <param name="sender">The ViewModel</param>
        /// <param name="e">Event args</param>
        void _Vm_CloseLinks(object sender, EventArgs e) {
            Close();
        }
    }
}
